package com.tool.btn;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.MouseEvent;

import javax.swing.SwingConstants;

import com.tool.tcpimg.UIUtils;
import org.come.until.FormsManagement;

public class RuneOPerBtn extends MoBanBtn {

    private int caozuo;

    public RuneOPerBtn(String iconpath, int type, int caozuo) {
        super(iconpath, type);
        this.caozuo = caozuo;
        if (caozuo == 1) {
            setText("重铸");
        } else if (caozuo == 2) {
            setText("升级");
        }
        setFont(UIUtils.nameFont);
        setForeground(Color.orange);
        setVerticalTextPosition(SwingConstants.CENTER);
        setHorizontalTextPosition(SwingConstants.CENTER);
    }

    public RuneOPerBtn(String iconpath, int type, Color[] colors, Font font, String text, int caozuo) {
        super(iconpath, type, colors);
        this.caozuo = caozuo;
        setText(text);
        setFont(font);
        setVerticalTextPosition(SwingConstants.CENTER);
        setHorizontalTextPosition(SwingConstants.CENTER);
    }

    @Override
    public void chooseyes() {
        // TODO Auto-generated method stub

    }

    @Override
    public void chooseno() {
        // TODO Auto-generated method stub

    }

    @Override
    public void nochoose(MouseEvent e) {
        if (caozuo == 1) {// 重铸

        } else if (caozuo == 2) {// 升级

        } else if (caozuo == 3) {// 重铸规则
            if (!FormsManagement.getframe(72).isVisible()) {
                FormsManagement.showForm(72);
            } else {
                FormsManagement.HideForm(72);
            }
        } else if (caozuo == 4) {// 升级规则
            if (!FormsManagement.getframe(72).isVisible()) {
                FormsManagement.showForm(72);
            } else {
                FormsManagement.HideForm(72);
            }
        } else if ("升级规则".equals(getText())) {
            if (!FormsManagement.getframe(72).isVisible()) {
                FormsManagement.showForm(72);
            } else {
                FormsManagement.HideForm(72);
            }

        } else if ("重铸规则".equals(getText())) {
            if (!FormsManagement.getframe(72).isVisible()) {
                FormsManagement.showForm(72);
            } else {
                FormsManagement.HideForm(72);
            }

        }
        }
    }


